package com.validant.enigma3.uat;

import com.validant.enigma3.common.UIMap;
import com.validant.enigma3.controls.ExtWebDriver;
import com.validant.enigma3.controls.ExtWebElement;

public class LoginLib {
	
	// control names defined in UIMap.xls
	public static final String CTRL_USER = "User Name";
	public static final String CTRL_PASS = "Password";
	public static final String CTRL_REGISTER = "Register";
		
	public static void enterData(ExtWebDriver driver, UIMap uimap, String user, String pass) {
		ExtWebElement ctrlUser= new ExtWebElement(driver.waitForElementVisible(uimap.getElement(CTRL_USER)));
		ExtWebElement ctrlPass= new ExtWebElement(driver.waitForElementVisible(uimap.getElement(CTRL_PASS)));
		ctrlUser.sendKeys(user);
		ctrlPass.sendKeys(pass);
	   
		ExtWebElement register= new ExtWebElement(driver.waitForElementVisible(uimap.getElement(CTRL_REGISTER)));
		register.click();
	}
}
